import pymysql

con = pymysql.connect(host="localhost", port=3306, user="root", password="cxd@949846.com")
con.select_db('db_python')
username = input('请输入用户名：')
cursor = con.cursor()
cursor.execute(f"select * from user where username = '{username}'")
result = cursor.fetchone()
print(result)
con.close()